package com.qumitech.visualnovel.datasource.console;

import com.qumitech.visualnovel.model.dao.console.OrderDO;
import com.qumitech.visualnovel.pubdef.dto.associate.AssociateAccountDTO;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface OrderDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(OrderDO record);

    int insertSelective(OrderDO record);

    OrderDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderDO record);

    int updateByPrimaryKey(OrderDO record);

    List<HashMap<String, String>> getRank(@Param("startTime")String startTime,
                                          @Param("endTime")String endTime );

    List<AssociateAccountDTO> listAccountByDimension(@Param("dimension") String dimension,
                                                     @Param("dimensionValue") String dimensionValue,
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime,
                                                     @Param("orderType") String orderType,
                                                     @Param("orderBy") String orderBy,
                                                     @Param("offset") Integer offset,
                                                     @Param("limit") Integer limit);

    int countAccountByDimension(@Param("dimension") String dimension,
                                @Param("dimensionValue") String dimensionValue,
                                @Param("startTime") String startTime,
                                @Param("endTime") String endTime);

    List<HashMap<String, String>> listRankByDimension(@Param("dimension") String dimension,
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime,
                                                     @Param("orderType") String orderType,
                                                     @Param("orderBy") String orderBy,
                                                     @Param("offset") Integer offset,
                                                     @Param("limit") Integer limit);

    int countRankByDimension(@Param("dimension") String dimension,
                                @Param("startTime") String startTime,
                                @Param("endTime") String endTime);
}